<?php

class Relato extends Entidad {

    static $rules = [
        'titulo' => 'required|max:90',
        'texto' => 'required',
        'bajada' => 'required|max:600',
    ];

    function __construct() {
        parent::__construct();
        $this->guarded = array('id');
        $this->fillable = array('titulo','bajada','texto','slug','position','estado');
        
        $this->tagModel = 'TagRel'; // Ej: TagRel
        $this->imageModel = 'Imagerel'; // Imagerel
        $this->tagsId = 'tag_rels.id'; // 'tag_rels.id'
    }

    /*----------- RELATIONS -----------*/
    
    public function objetos() {
        return $this->belongsToMany('Objeto');
    }
    
}
